new Vue({
  el: '#app',
  data() {
    return {
      shop: false,
      form: {
        Member_Rights_Name: '',
        page: 1,			//页数
        limit: 10,			//每页数据条数
        token: $.cookie("token")
      },
      formData: {},
      tableData: [{}],		//表格数据
      total: 1,
      Pic: [],
      dialogForm: false,
      title: '',
      multipleSelection: []
    }
  },
  mounted() {
    this.getList(this.form)
  },
  methods: {
    onSerach() {				//查询方法
      // console.log(this.form.Member_Rights_Name)
      this.getList(this.form)
    },
    addContract() {
      console.log("跳转")
    },
    getList(data) {     //换页方法
      let _this = this
      $.ajax({
        type: 'POST',
        //	url: "../getContractListByConditionAction",
        url: DomainName + '/getMemberRightsAction',
        data,
        success: function (res) {
          console.log(res);
          _this.tableData = res.tableData
          _this.tableData.forEach(item => {
            item.App_Name = item.App_Name.split('_')
            console.log(item.App_Name)
          })
          _this.total = parseInt(res.limit)
          // _this.tableData = Result      //将获取的数据存到表格数据中
        },
        complete: function (XMLHttpRequest) {
          if (XMLHttpRequest.getResponseHeader("REDIRECT") == "REDIRECT") {
            window.parent.document.location.href = "../../../../" + XMLHttpRequest.getResponseHeader("CONTENTPATH");
          }
        },
        dataType: "json"
      });
    },
    // 展示图片
    handlePreview(Article_SerialNumber) {
      this.Pic = []
      this.tablePic.filter(item => {
        return item.Picture_Type == '0' && item.Article_SerialNumber == Article_SerialNumber
      }).forEach(item => {
        this.Pic.push(item.Picture_Url)
      })
      console.log(this.Pic);
    },
    // 分页查询
    handleCurrentChange(val) {
      this.form.page = val;
      this.getData(this.form)
    },
    handleSizeChange(val) {//分页查询
      this.form.page = 1;
      this.form.limit = val;
      this.getData(this.form)
    },
    addEnterprise() {
      window.location.href = './Add.html'
    },
    showMember(EnterpriseInfo_SerialNumber) {
      sessionStorage.setItem("EnterpriseInfo_SerialNumber", EnterpriseInfo_SerialNumber)
      window.location.href = './show.html?EnterpriseInfo_SerialNumber=' + EnterpriseInfo_SerialNumber
    },
    // 编辑
    editMember(Member_Rights_SerialNumber) {
      // console.log(Member_Rights_SerialNumber)
      sessionStorage.setItem("Member_Rights_SerialNumber", Member_Rights_SerialNumber)
      window.location.href = './Edit.html?Member_Rights_SerialNumber=' + Member_Rights_SerialNumber
    },
    upMember(Member_Rights_SerialNumber) {
      this.shop = !this.shop
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    }
  },
})